package com.bs.manager05.service.impl;

import com.bs.manager05.entity.Rolemenu;
import com.bs.manager05.mapper.RolemenuMapper;
import com.bs.manager05.service.IRolemenuService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * <p>
 * 角色菜单关联表 服务实现类
 * </p>
 *
 * @author yao
 * @since 2022-12-18
 */
@Service
public class RolemenuServiceImpl extends ServiceImpl<RolemenuMapper, Rolemenu> implements IRolemenuService {

    @Resource
    RolemenuMapper mapper;
    @Override
    @Transactional
    public int addMenus(String roleid, String[] menuids) {
        mapper.delMenuById(roleid);
        int row = mapper.addMenus(roleid, menuids);
        return row;
    }
}
